/*Autor: Donaldo Chavez*/
/*Colaboracion: Freddy Fernandez "Aprendiz"*/
function createAccordion(idParent,classChilds,alwaysOpen,autoheight,multiopen,active){

    jQuery().ready(function(){
        jQuery(idParent).accordion({ 
		    header: classChilds, 
		    active: '',
		    alwaysOpen: alwaysOpen, 
		    animated: false, 
		    autoheight: autoheight,
		    multiopen: multiopen 
	    });
	  });	
	  
}
/*Ajax*/
function createAccordionAll(text){
    var Accor = text.split("|||");
    for(x =0; x<=Accor.length-1;x++){
        var Data = Accor[x].split("||");
        var alwaysOpen = (Data[2] == "true") ? true : false
        var autoheight = (Data[3] == "true") ? true : false
        var multiopen = (Data[4] == "true") ? true : false
        createAccordion(Data[0],Data[1],alwaysOpen,autoheight,multiopen,Data[5])
    }
}

function setActivePanel(id,panel){
    $(panel + " .x-menu-parent").removeClass("menu-active")
    $(id).addClass('menu-active');
}

function setActivePanelDetail(id,panel){
    $(".menu-activeDetail").removeClass("menu-activeDetail")
    $("span",".menu-activeDetail").css('width',"");
    $("span",id).addClass('menu-activeDetail');
    $("span",id).css('width',"130px");
    
    }

function setExpand(id,span){
    if( $(id).css("display") == 'none' ){     
        $(span).addClass("iconContract");
        $(span).removeClass("iconExpand");
    }else{
        $(span).addClass("iconExpand");
        $(span).removeClass("iconContract");
    }
    
}

function setDisplayPanel(id){
    window.setTimeout(function(){setDisplayBlockPanel(id)}, 100)
     
   // setDisplayBlockPanel(id)
}

function setDisplayBlockPanel(id){
    $(id).css("display","block");
 /*   if($(id) != null) 
        $(id).css("display","");
    else
        window.setTimeout(function(){setDisplayBlockPanel(id)}, 100)*/
}